var $j = jQuery.noConflict();

$j(document).ready(function(){
	
	getUserInfo();
	
	inputUsername = $j("#username");
	msgErrorUsername = $j("#msgErrorUsername");
	spanUsername = $j("#spanUsername");
	
	inputName = $j("#name");
	spanName = $j("#spanName");
	msgErrorName = $j("#msgErrorName");
	
	inputOldPass = $j("#oldPassword");
	spanOldPass = $j("#spanOldPassword");
	
	inputNewPass = $j("#newPassword");
	spanNewPass = $j("#spanNewPassword");
	
	inputConfirmPass = $j("#confirmPassword");
	spanConfirmPass = $j("#spanConfirmPassword");
	msgErrorConfirmPass = $j("#msgErrorConfirmPass");
	
	msgErrorPass = $j("#msgErrorPass");
	
	inputEmail = $j("#email");
	spanEmail = $j("#spanEmail");
	msgErrorEmail = $j("#msgErrorEmail");
	
	inputBirthDate = $j("#birth_date");
	spanBirthDate = $j("#spanBirthDate");
	msgErrorDate = $j("#msgDate");
	
	//controlamos la validacion en los distintos eventos
	// Perdida de foco
	inputUsername.blur(validateUsername);
	inputName.blur(validateName);
	inputOldPass.blur(validateOldPass);
	inputNewPass.blur(validateNewPass);
	inputConfirmPass.blur(validateConfirmPass);
	inputEmail.blur(validateEmail);
	inputBirthDate.blur(validateBirthDate);
	
	// Pulsacion de tecla
	inputUsername.keyup(validateUsername);
	inputName.keyup(validateName);
	inputOldPass.keyup(validateOldPass);
	inputNewPass.keyup(validateNewPass);
	inputConfirmPass.keyup(validateConfirmPass);
	inputEmail.keyup(validateEmail);
	inputBirthDate.keyup(validateBirthDate);

});